.box {
  padding: 80px 0 40px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  /* 相对定位 */
  position: relative;
  /* 开启3D效果 */
  transform-style: preserve-3d;
  /* 设置视距 */
  perspective: 1000px;
  /* 默认沿X轴旋转-20度 */
  transform: rotateX(-25deg);
  height: 250px;
  animation: mymovebox 5s infinite;
  -webkit-animation: mymovebox 5s infinite; /* Safari and Chrome */


  /* 箱子各个面的统一样式 */

  .side {
    /* 绝对定位 */
    position: absolute;
    width: 160px;
    height: 160px;
    background-color: #c09551;
    /* border: 1px solid #e4c084; */
  }

  /* 前 */

  .front {
    transform: translateZ(80px);
    background: rgba(48, 48, 48, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;

    > p {
      font-size: 30px;
      text-shadow: 2px -2px 2px #000;
    }

    > small {
      text-shadow: 2px -2px 2px #000;
    }

    /* background: url("http://www.hongniang.com/public/home/images/banner20192.png") no-repeat center / cover; */
  }

  /* 后 */

  .back {
    transform: translateZ(-80px) rotateY(180deg);
    /* 渐变 */
    background: linear-gradient(to left, #dadff6, #f6e3ef);
    background: url("../../../../assets/images/boxbg.webp") no-repeat center / cover;
    /* opacity: 1; */
  }

  /* 左 */

  .left {
    transform: translateX(-80px) rotateY(-90deg);
    background: url("../../../../assets/images/boy.png") no-repeat center / cover;
    opacity: 0.85;
  }

  /* 右 */

  .right {
    transform: translateX(80px) rotateY(90deg);
    background: url("../../../../assets/images/left.png") no-repeat center / cover;
    opacity: 0.85;
  }

  /* 上 */

  .top {
    transform: translateY(-80px) rotateX(90deg);
    background-color: transparent;
    transform-style: preserve-3d;
  }

  .top div {
    background-color: #c09551;
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    /* border: 1px solid #e4c084; */
    /* 设置过渡 */
    transition: 0.5s;
  }

  .top .tl {
    left: 0;
    /* 设置旋转的基点位置为左边 */
    transform-origin: left;
    // background: url("https://clf-blind-box.oss-cn-hangzhou.aliyuncs.com/static/boy.png") no-repeat center / cover;
    background: rgba(0, 0, 0, 0.6);
    color: skyblue;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    > p {
      font-size: 24px;
      text-shadow: 2px -2px 2px #000;
    }

    > small {
      text-shadow: 2px -2px 2px #000;
    }
  }

  .top .tr {
    right: 0;
    /* 设置旋转的基点位置为右边 */
    transform-origin: right;

    background: rgba(0, 0, 0, 0.6);
    color: pink;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    > p {
      font-size: 24px;
      text-shadow: 2px -2px 2px #000;
    }

    > small {
      text-shadow: 2px -2px 2px #000;
    }
  }

  /* 下 */

  .bottom {
    transform: translateY(80px) rotateX(90deg);
    /* 阴影 */
    box-shadow: 5px -5px 15px rgba(0, 0, 0, 0.6);
    /* background: rgba(0, 0, 0, 1); */
    background: url("../../../../assets/images/boxbg.webp") no-repeat center / cover;


  }

  .box.box-open .top .tl {
    transform: rotateY(-135deg);
  }

  .box.box-open .top .tr {
    transform: rotateY(135deg);
  }

  .box .text {
    // width: 160px;
    text-align: center;
    // font-size: 30px;
    // font-weight: bold;
    transition: 0.6s;
  }

  .box.box-open .text {
    transform: translateY(-150px);
  }
}


@keyframes mymovebox {
  0% {
    transform: rotateX(-25deg) rotateY(0deg);
  }

  33% {
    transform: rotateX(-45deg) rotateY(45deg);
  }

  66% {
    transform: rotateX(-25deg) rotateY(-45deg);
  }

  /* 75% {
    transform: rotateX(-45deg) rotateY(45deg);
  } */

  100% {
    transform: rotateX(-25deg) rotateY(0deg);
  }
}

@-webkit-keyframes mymovebox

  /* Safari and Chrome */ {
  0% {
    transform: rotateX(-25deg) rotateY(0deg);
  }

  33% {
    transform: rotateX(-45deg) rotateY(45deg);
  }

  66% {
    transform: rotateX(-25deg) rotateY(-45deg);
  }

  /* 75% {
    transform: rotateX(-45deg) rotateY(45deg);
  } */

  100% {
    transform: rotateX(-25deg) rotateY(0deg);
  }
}